package com.dameng.system.service.impl;

import com.dameng.system.entity.SystemMenu;
import com.dameng.system.mapper.SystemMenuMapper;
import com.dameng.system.service.SystemMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SystemMenuServiceImpl extends ServiceImpl<SystemMenuMapper, SystemMenu> implements SystemMenuService {

    @Resource
    SystemMenuMapper systemMenuMapper;

    @Override
    public List<SystemMenu> getMenuByUserId(String userId) {
        return systemMenuMapper.getMenuByUserId(userId);
    }

    @Override
    public List<SystemMenu> childMenuByUserId(String userId, String menuId) {
        return systemMenuMapper.childMenuByUserId(userId, menuId);
    }

    @Override
    public List<SystemMenu> getMenusByRoleId(String roleid) {
        return systemMenuMapper.getMenusByRoleId(roleid);
    }

    @Override
    public List<String> childMenuByMenuId(String menuId) {
        return systemMenuMapper.childMenuByMenuId(menuId);
    }
}
